package chuangyi.com.org.ViewModel;

import android.content.Context;
import android.databinding.Bindable;
import android.view.View;

import chuangyi.com.org.DOMIHome.BR;
import chuangyi.com.org.DOMIHome.R;

/**
 * Created by zxh on 16/12/19.
 */

public class VideoPayModel extends PayModel {
    private double videoPrice;
    private double seasonPrice;
    private double allVideoPrice;
    private double score;

    private boolean videoSelected;
    private boolean seasonSelected;
    private boolean allSelected;

    @Bindable
    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Bindable
    public boolean isVideoSelected() {
        return videoSelected;
    }

    public void setVideoSelected(boolean videoSelected) {
        this.videoSelected = videoSelected;
        if (videoSelected) {
            setSeasonSelected(false);
            setAllSelected(false);
        }
        notifyPropertyChanged(BR.videoSelected);
    }

    @Bindable
    public boolean isSeasonSelected() {
        return seasonSelected;
    }

    public void setSeasonSelected(boolean seasonSelected) {
        this.seasonSelected = seasonSelected;
        if (seasonSelected) {
            setVideoSelected(false);
            setAllSelected(false);
        }
        notifyPropertyChanged(BR.seasonSelected);
    }

    @Bindable
    public boolean isAllSelected() {
        return allSelected;
    }

    public void setAllSelected(boolean allSelected) {
        this.allSelected = allSelected;
        if (allSelected) {
            setSeasonSelected(false);
            setVideoSelected(false);
        }
        notifyPropertyChanged(BR.allSelected);
    }

    @Bindable
    public double getVideoPrice() {
        return videoPrice;
    }

    public void setVideoPrice(double videoPrice) {
        this.videoPrice = videoPrice;
    }

    @Bindable
    public double getSeasonPrice() {
        return seasonPrice;
    }

    public void setSeasonPrice(double seasonPrice) {
        this.seasonPrice = seasonPrice;
    }

    @Bindable
    public double getAllVideoPrice() {
        return allVideoPrice;
    }

    public void setAllVideoPrice(double allVideoPrice) {
        this.allVideoPrice = allVideoPrice;
    }

    public VideoPayModel(Context context) {
        super(context, 0);
        super.addScorePay();
        this.videoSelected = true;
    }

    public void onClickVideo(View view) {
        setVideoSelected(true);
    }

    public void onClickSeason(View view) {
        setSeasonSelected(true);
    }

    public void onClickAll(View view) {
        setAllSelected(true);
    }
}
